﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using StructureMap.Configuration.DSL;
using PowerBooking.RSE.IRepository;
using PowerBooking.RSE.Repository.Repositories;
using PowerBooking.RSE.Repository.Contexts;

namespace PowerBooking.RSE.IoC
{
    /// <summary>
    /// 仓储层IoC注册
    /// </summary>
    public class RepositoryRegistry : Registry
    {
        public RepositoryRegistry()
        {
            IUnitOfWork unitwork = new RestaurantSpiderEngineContext();

            For<ISpiderRepository>().Use<SpiderRepository>().Ctor<IUnitOfWork>().Is(unitwork);
            For<ICityRepository>().Use<CityRepository>().Ctor<IUnitOfWork>().Is(unitwork);
            For<IFilterRepository>().Use<FilterRepository>().Ctor<IUnitOfWork>().Is(unitwork);
            For<IRestaurantRepository>().Use<RestaurantRepository>().Ctor<IUnitOfWork>().Is(unitwork);
        }
    }
}
